﻿//------------------------------------------------------------------------------
// <pcdd-entitiy>
//     代理业务类库
//     通知业务对象
// </pcdd-entitiy>
//------------------------------------------------------------------------------

using System.Collections.Generic;
using CL.Business.DAL;
using CL.Business.Entity;

namespace CL.Business.BLL
{
    public class NoticeBLL
    {
        NoticeDAL dal = new NoticeDAL(Enum.Common.DbConnectionEnum.CaileBusiness);

        /// <summary>
        /// 设置已读
        /// </summary>
        /// <param name="IDs"></param>
        /// <returns></returns>
        public bool ReadNotice(List<int> IDs)
        {
            return dal.ReadNotice(IDs);
        }
        /// <summary>
        /// 设置已读
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public bool ReadNotice(int ID)
        {
            return dal.ReadNotice(ID);
        }
        /// <summary>
        /// 插入对象集
        /// </summary>
        /// <param name="Entitys"></param>
        /// <returns></returns>
        public bool InsertNotice(List<NoticeEntity> Entitys)
        {
            return dal.InsertNotice(Entitys);
        }
        /// <summary>
        /// 插入对象
        /// </summary>
        /// <param name="Entity"></param>
        /// <returns></returns>
        public int InsertNotice(NoticeEntity Entity)
        {
            return dal.InsertNotice(Entity);
        }
        /// <summary>
        /// 查询未读数
        /// </summary>
        /// <param name="UnionID"></param>
        /// <returns></returns>
        public int QueryUnReadCount(int UnionID)
        {
            return dal.QueryUnReadCount(UnionID);
        }

        /// <summary>
        /// 获取一条消息
        /// </summary>
        /// <param name="UnionID"></param>
        /// <returns></returns>
        public NoticeEntity GetNotice(long UnionID)
        {
            return dal.SelectNoticeDal(UnionID);
        }

        /// <summary>
        /// 查询公告列表
        /// </summary>
        /// <param name="AccountID">代理账号标识</param>
        /// <param name="IsRead">消息状态</param>
        /// <param name="Keyword">关键字</param>
        /// <param name="PageIndex">当前页</param>
        /// <param name="PageSize">页大小</param>
        /// <param name="RecordCount">消息总数</param>
        /// <param name="UnReadCount">未读消息数量</param>
        /// <returns></returns>
        public List<NoticeEntity> QueryMyNotice(int AccountID, int IsRead, string Keyword, int PageIndex, int PageSize, ref int RecordCount, ref int UnReadCount)
        {
            return dal.QueryMyNotice(AccountID, IsRead, Keyword, PageIndex, PageSize, ref RecordCount, ref UnReadCount);
        }

        /// <summary>
        /// 删除对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DelEntity(int id)
        {
            return dal.DelEntity(id);
        }

    }
}
